{include file="$MODULES_DIR/backoffice/templates/block/modal/ModalTitle.html" title=$fileName}
<div id="modalContent" class="withoutFooter" style="display: block; height: 140px;">
    
    <div style="background: #E8E8DE; display: block; width: 100%; height: 20px; padding: 3px 0; text-align: center;">
        {hasRight rule=medias_Edit}
        {hasDocRight document=$media module="medias" rule="edit"}
        <span style="display: block; width: 20px; height: 20px; left: 48%; position: relative;">
        <a href="?module=backoffice&action=AjaxContext&href={$media->getEditUrl($media->getFolderId())}" class="nyroModal openModal itemButton itemEditButton"></a>
        </span>
        {/hasDocRight}
        {/hasRight}
        <div class="clear"></div>
    </div>

    <div style="width: 100%">
        <table>
            <tr>
                {if $previousImage != null}<td style="width: 20px; vertical-align: middle; padding: 5px;"><a href="?module=backoffice&action=AjaxContext&href={url route='mediaViewImage' docId=$previousImage->getUniqueId() docLang=$previousImage->getLang() width='default' height='default'}" class="nyroModal openModal arrowButton arrowButtonLeft"></a></td>{else}<td style="width: 20px; vertical-align: middle; padding: 5px;">&nbsp;&nbsp;&nbsp;&nbsp;</td>{/if}
                <td style="width:100%; text-align: center; padding: 5px;">
                    {if $media->isLink()}
                        {$media->getLinkPreview()}
                    {else}
                    <a href="?module=medias&action=AjaxDownloadFile&docId={$media->getId()}&docLang={$media->getLang()}" title="{t}Click to download file{/t}">
                        <img src="{$media->getIcon(true, false, '9696')}" alt="{t}Click to download file{/t}" title="{t}Click to download file{/t}" />
                    </a>
                    {/if}
                    <a href="?module=medias&action=AjaxDownloadFile&docId={$media->getUniqueId()}&docLang={$media->getLang()}" title="{t}Click to download file{/t}"><img src="{$media->getIcon(true, false, '9696')}" alt="{t}Click to download file{/t}" title="{t}Click to download file{/t}" /></a>
                </td>
                {if $nextImage != null}<td style="width: 20px; vertical-align: middle; padding: 5px;"><a href="?module=backoffice&action=AjaxContext&href={url route='mediaViewImage' docId=$nextImage->getUniqueId() docLang=$nextImage->getLang() width='default' height='default'}" class="nyroModal openModal arrowButton arrowButtonRight"></a></td>{else}<td style="width: 20px; vertical-align: middle; padding: 5px;">&nbsp;&nbsp;&nbsp;&nbsp;</td>{/if}
            </tr>
        </table>
    </div>

    <script type="text/javascript">
        {literal}
        $(".openModal").nyroModal({
            minHeight: null,
            minWidth: null,
            modal: true,
            bgColor: '#D4D0C8'
        });
        {/literal}
    </script>
</div>
{include file="$MODULES_DIR/backoffice/templates/block/modal/ModalFooter.html" noButton="true"}